#定义方法，来代替页面的方法
from appium.webdriver.common.mobileby import MobileBy
from appium.webdriver.webdriver import WebDriver

from appium0704.appiumpo.BasePage import BasePage
from appium0704.appiumpo.ContactPage import ContactPage


class MainPage(BasePage):
    _contact_element = (MobileBy.XPATH, "//*[@text='通讯录']")
    def goto_contact(self):
        # self.driver.find_element(MobileBy.XPATH, "//*[@text='通讯录']").click()
        self.find_and_click(*self._contact_element)
        return ContactPage(self.driver)
